﻿-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================

CREATE PROCEDURE [dbo].[InsertTargetAreaCircle]
	-- Add the parameters for the stored procedure here
	@TargetAreaKey int,
	@Lat nvarchar(100),
	@Lon nvarchar(100),
	@Radius nvarchar(100)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	update [TargetArea] 
	Set [Polygon] = geography::Point(@Lat,@Lon,4326).STBuffer(@Radius)
	WHERE @TargetAreaKey=[Id] 
END
;
